package com.dimanche.library_db.entity;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.TypeConverters;

import com.dimanche.library_db.base.BaseDbEntity;
import com.dimanche.library_db.converter.TimestampConverter;

import java.sql.Date;

/**
 * author : Dimanche
 * date   : 2021/3/10 13:44
 * desc   :用户所有课程列表及进度
 * version: 1.0
 */
@Entity(tableName = "UserCourse")
public class UserCourseEntity extends BaseDbEntity {

    /**
     * 用户ID
     */
    @ColumnInfo(name = "userId")
    public int userId;

    /**
     * 课程id
     */
    @ColumnInfo(name = "courseId")
    public int courseId;

    /**
     * 进度
     */
    @ColumnInfo(name = "progress")
    public double progress;

    /**
     * 添加课程的时间
     */
    @TypeConverters(TimestampConverter.class)
    @ColumnInfo(name = "startDate")
    public Date startDate;

    /**
     * 上次打开的时间（学习的时间）
     */
    @TypeConverters(TimestampConverter.class)
    @ColumnInfo(name = "lastDate")
    public Date lastDate;

    /**
     * 课程结束的时间
     */
    @TypeConverters(TimestampConverter.class)
    @ColumnInfo(name = "finishDate")
    public Date finishDate;




}
